﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Colorful.Furniture.Enum;
using Colorful.Furniture.IEntity;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.ErpOrderManagement;

/// <summary>
/// 充值订单表
/// </summary>
[Table(Name = "erp_recharge_order")]
public class RechargeOrder : AuditTenantSoftDeleteAggregateRoot
{
    /// <summary>
    /// 订单编码
    /// </summary>
    [Column(Name = "id", IsPrimary = true)]
    public Guid Id { get; set; }

    /// <summary>
    /// 平台订单号
    /// </summary>
    [Column(Name = "order_no", StringLength = 60)]
    public string OrderDownNo { get; set; }

    /// <summary>
    /// 合作商唯一订单号
    /// </summary>
    [Column(Name = "out_trade_no", StringLength = 60)]
    public string OutTradeNo { get; set; }

    /// <summary>
    /// 充值账号
    /// </summary>
    [Column(Name = "recharge_account", StringLength = 50)]
    public string RechargeAccount { get; set; }

    /// <summary>
    /// 售卖数量
    /// </summary>
    [Column(Name = "qty")]
    public int? Qty { get; set; }

    /// <summary>
    /// 售卖单价
    /// </summary>
    [Column(Name = "price", Scale = 4, Precision = 16)]
    public decimal? Price { get; set; }

    /// <summary>
    /// 售卖总价
    /// </summary>
    [Column(Name = "total_price", Scale = 4, Precision = 16)]
    public decimal? TotalPrice { get; set; }

    /// <summary>
    ///  平台服务费
    /// </summary>
    [Column(Name = "service_fee", Scale = 4, Precision = 16)]
    public decimal? ServiceFee { get; set; }

    /// <summary>
    /// 商品Id
    /// </summary>
    [Column(Name = "product_id")]
    public Guid? ProductId { get; set; }

    /// <summary>
    /// 商品编码
    /// </summary>
    [Column(Name = "product_no")]
    public string ProductNo { get; set; }

    /// <summary>
    /// 商品名称
    /// </summary>
    [Column(Name = "product_name")]
    public string ProductName { get; set; }

    /// <summary>
    /// 客户Id
    /// </summary>
    [Column(Name = "customer_id")]
    public Guid? CustomerId { get; set; }

    /// <summary>
    /// 客户编码
    /// </summary>
    [Column(Name = "customer_code")]
    public int? CustomerCode { get; set; }

    /// <summary>
    ///  客户名称
    /// </summary>
    [Column(Name = "customer_name", StringLength = 100)]
    public string CustomerName { get; set; }

    /// <summary>
    /// 供应商Id
    /// </summary>
    [Column(Name = "supplier_id")]
    public Guid? SupplierId { get; set; }

    /// <summary>
    ///  供应商名称
    /// </summary>
    [Column(Name = "supplier_name", StringLength = 100)]
    public string SupplierName { get; set; }

    /// <summary>
    ///  供应商编号
    /// </summary>
    [Column(Name = "supplier_merchant_id", StringLength = 40)]
    public string SupplierMerchantId { get; set; }

    /// <summary>
    /// 供应商成本单价
    /// </summary>
    [Column(Name = "supplier_price", Scale = 4, Precision = 16)]
    public decimal? SupplierPrice { get; set; }

    /// <summary>
    /// 给供应商下单个数
    /// </summary>
    [Column(Name = "supplier_submit_number")]
    public int? SupplierSubmitNumber { get; set; }

    /// <summary>
    /// 供应商成本合计金额
    /// </summary>
    [Column(Name = "supplier_total_price", Scale = 4, Precision = 16)]
    public decimal? SupplierTotalPrice { get; set; }

    /// <summary>
    ///  提交订单时刻的商品换算比例
    /// </summary>
    [Column(Name = "supplier_qty")]
    public int? SupplierQty { get; set; }

    /// <summary>
    /// 店铺实际支付金额
    /// </summary>
    [Column(Name = "pay_amount", Scale = 4, Precision = 16)]
    public decimal? PayAmount { get; set; }

    /// <summary>
    /// 供应商商品代码
    /// </summary>
    [Column(Name = "supplier_product_no")]
    public string SupplierProductNo { get; set; }

    /// <summary>
    /// 供应商商品名称
    /// </summary>
    [Column(Name = "supplier_product_name")]
    public string SupplierProductName { get; set; }

    /// <summary>
    /// 供应商订单编号
    /// </summary>
    [Column(Name = "supplier_order_no")]
    public string SupplierOrderNo { get; set; }

    /// <summary>
    ///  产品类型
    /// </summary>
    [Column(Name = "product_type")]
    public ProductType? ProductType { get; set; }

    /// <summary>
    /// 订单状态：-1=充值失败；2=充值中；1=充值成功；
    /// </summary>
    [Column(Name = "status")]
    public EnumOrderStatus? Status { get; set; }

    /// <summary>
    /// 订单状态排序：0=充值中；1=存疑；充值失败/充值成功=2；
    /// </summary>
    [Column(Name = "order_status")]
    public int? OrderStatus { get; set; }

    /// <summary>
    ///  回调地址
    /// </summary>
    [Column(Name = "notify_url", StringLength = 300)]
    public string NotifyUrl { get; set; }

    /// <summary>
    ///  备注
    /// </summary>
    [Column(Name = "remark", StringLength = 600)]
    public string Remark { get; set; }

    /// <summary>
    ///  终端客户IP
    /// </summary>
    [Column(Name = "end_customer_ip", StringLength = 600)]
    public string EndCustomerIp { get; set; }

    /// <summary>
    ///  完成时间
    /// </summary>
    [Column(Name = "finish_time", Position = -84)]
    public DateTime? FinishTime { get; set; }

    /// <summary>
    /// 是否提交到上游：1 = 是；0 = 否；
    /// </summary>
    [Column(Name = "is_post_supplier")]
    public int? IsPostSupplier { get; set; }




}

